import request from '@/service'
// eslint-disable-next-line prettier/prettier
/** 用户的网络请求 */
// 查询
export function postUsersListData(queryInfo: any) {
  return request.get({
    url: '/users',
    params: {
      ...queryInfo
    }
  })
}
// 通过id查询
export function getUserInfoById(id: number) {
  return request.get({
    url: `/users/${id}`
  })
}

// 删除
export function deleteUserById(id: number) {
  return request.delete({
    url: `/users/${id}`
  })
}

// 添加
export function newUserData(userInfo: any) {
  return request.post({
    url: '/users/register',
    data: userInfo
  })
}


// 编辑
export function editUserData(id: number, userInfo: any) {
  console.log('id', id, userInfo)
  return request.put({
    url: `/users/${id}`,
    data: userInfo
  })
}



